<template>
    <table-dialog ref="dialogRef" title="历年查询" width="85%" :showFooter="false">
        <template #default>
            <div class="mod-home">
                <table-grid
                    ref="sxTableRef"
                    style="height: 100%;"
                    :button-list="buttonList"
                    tableTitle="历年查询"
                    :tableColumn="bmTableColumn"
                    :tableData="bmTableData"
                    @btnClick="sxBtnClick"
                ></table-grid>
            </div>
        </template>
    </table-dialog>
</template>

<script>
export default {
	data () {
		return {
			dialogTableVisible: false,
			buttonList: [
			
			],
			bmTableColumn: [
				{type: 'seq', width: 60},
				{type: 'checkbox', width: 50},
				{field: 'year', title: '年度'},
				{field: 'name', title: '客户'},
				{field: 'xse', title: '销售额', editRender: {name: 'VxeInput', props: { clearable: true }}},
				{field: 'fy', title: '费用', editRender: {name: 'VxeInput', props: { clearable: true }}},
				{field: 'hk', title: '回款', editRender: {name: 'VxeInput', props: { clearable: true }}},
				{field: 'db', title: '对比', editRender: {name: 'VxeInput', props: { clearable: true }}},
			],
			bmTableData: [
				{
                    year: "2025",
					name: "客户1",
                    xse: 20000,
					fy: 2000,
                    hk: 2000,
                    db: "80%",
				},
                {
                    year: "2025",
                    name: "客户2",
                    xse: 20000,
                    fy: 2000,
                    hk: 2000,
                    db: "80%",
                },
			],
		}
	},
	mounted () {

	},
	methods: {
		init(){
			this.$refs.dialogRef.openDialog();
		},
		sxBtnClick(btn){
			switch (btn.code) {
				case "add":
					this.$refs.sxTableRef.insert();
			}
		},
	}
}
</script>

<style lang="scss" scoped>
.mod-home{
	display: flex;
	justify-content: space-between;
	background-color: #f1f1f1;
}

</style>
